package com.kjtpay.design_pattern.template_method;

import android.util.Log;

abstract class TestPaper {
    public String testQuestion1() {
        String question = "\n第1题：\n" + "杨过得到，后来给了郭靖，练成倚天剑、屠龙刀的玄铁可能是[ ]\n"
                + "a.球磨铸铁 b.马口铁 c.高速合金钥 d.碳素纤维\n"
                + "答案：" + answer1() + "\n";
        Log.v("TestPaper", question);
        return question;
    }
    protected abstract String answer1();

    public String testQuestion2() {
        String question = "\n第2题：\n" + "杨过、程英、陆无双铲除了情花.造成[ ]\n"
                + "a.使这种植物不再害人 b.使一种珍稀物种灭绝 c.破坏了那个生物圈的生态平衡 d.造成该地区沙漠化\n"
                + "答案：" + answer2() + "\n";
        Log.v("TestPaper", question);
        return question;
    }
    protected abstract String answer2();

    public String testQuestion3() {
        String question = "\n第3题：\n" + "蓝凤凰致使华山师徒、桃谷六仙呕吐不止，如果你是大夫，会给他们开什么药[ ]\n"
                + "a.阿司匹林 b.牛黄解毒片 c.氟呱酸 d.让他们喝大量的生牛奶 e.以上全不对\n"
                + "答案：" + answer3() + "\n";
        Log.v("TestPaper", question);
        return question;
    }
    protected abstract String answer3();

    public String display() {
        return testQuestion1() + testQuestion2() + testQuestion3();
    }
}
